package cn.fanqinghong.ymcc.feignClient;

import cn.fanqinghong.ymcc.constants.CommonConstants;
import cn.fanqinghong.ymcc.domain.MessageEmail;
import cn.fanqinghong.ymcc.domain.MessageSms;
import cn.fanqinghong.ymcc.result.JSONResult;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

import java.util.List;

/**
 * FAN
 * 2022/7/19  14:03
 */
@FeignClient(value = "service-common",fallbackFactory = MessageSmsFallbackFactory.class)
@RequestMapping("/messageSms")
public interface MessageSmsFeignClient {

    /**
     * 通过手机号获取对象
     */
    @RequestMapping(value = "/getByMobile/{mobile}",method = RequestMethod.GET)
    JSONResult get(@PathVariable("mobile") String mobile);

    /**
     * 批量设置userId
     * @param messageSms
     * @return
     */
    @RequestMapping(value="/batch",method= RequestMethod.POST)
    JSONResult batch(@RequestBody List<MessageSms> messageSms);

    /**
     *批量保存
     */
    @RequestMapping(value="/saveBatch",method= RequestMethod.POST)
    public JSONResult saveBatch(@RequestBody List<MessageSms> messageSmss);
}
